﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.Framework
{
    /// <summary>
    /// 用户类型：
    /// 1.网站会员；2.协会会员；3.网站后台管理员。
    /// </summary>
    public enum MemberType { Website = 1, Union, WebAdmin }

    public class Member
    {
        public string GID { get; set; }
        public string MemberID { get; set; }
        public string MemPasswd { get; set; }
        public string NickName { get; set; }
        public DateTime CreateTime { get; set; }
        public string Email { get; set; }
        public DateTime? LastLoginTime { get; set; }
        public int? LoginCount { get; set; }
        public byte MemStatus { get; set; }
        public byte MemType { get; set; }
        public string HeadPic { get; set; }
        public byte? EmailValid { get; set; }

        public static Member AsMember(FW_Member fwmem)
        {
            Member member = new Member
            {
                GID = fwmem.GID,
                MemberID = fwmem.MemberID,
                MemPasswd = fwmem.MemPasswd,
                NickName = fwmem.NickName,
                CreateTime = fwmem.CreateTime,
                Email = fwmem.Email,
                LastLoginTime = fwmem.LastLoginTime,
                LoginCount = fwmem.LoginCount,
                MemStatus = fwmem.MemStatus,
                MemType = fwmem.MemType,
                HeadPic = fwmem.HeadPic,
                EmailValid = fwmem.EmailValid
            };
            return member;
        }
    }
}
